package com.dk.controller;

import com.dk.data.Result;
import com.dk.service.GoodsSevice;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RequestMapping("freemarker")
@RestController
@Api(value = "生成静态页面")
public class FreemarkerController {
    @Autowired
    private GoodsSevice goodsSevice;

    @GetMapping
    @ApiOperation(value = "根据商品id查询数据")
    public Result selectByGoodsId(@RequestParam("goodsId") Long goodsId){
        Map map = goodsSevice.creagePage(goodsId);
        return Result.ok().setData(map);
    }
}
